@POST.change-password.php

<?php

$core = $package->compo('Core');
$email = $_POST['email'];

$lia->gotoWithContent($package->url('/'));
$user = $core->getLoggedInUser();

if ($user->isGuest()){
    echo "You aren't logged in, but you can still <a href=\"{$url}\">Reset your password</a>";
    return;
} else if (strtolower($user->email)!=strtolower($email)){
    $lia->gotoWithContent($package->url('/change-password/'));
    $acctUrl = $package->url('/');
    echo "The email you entered does not match the email for <a href=\"{$acctUrl}\">your account</a>. Please try again.";
    return;
}


$code = $core->newActivationCode($user);
$url = $package->get('Site.url').$package->url("/change-password/{$code}/");
$message = 'To change your password for '.$package->get('Site.name').' visit <a href="'.$url.'">'.$url.'</a>';
$core->sendEmail([
    'to'=>$user->email,
    'to.name'=>$user->name,
    'subject'=>'Password Change',
    'message'=>$message,
]);

?>

  <p>We've sent an email to <strong><?=$email?></strong> with a link to set your new password.</p>
  <p>If you haven't received the email in a couple minutes <a href="<?=$package->url('/change-password/');?>">try again</a> or contact <a href="mailto:<?=$package->get('Support.email');?>"><?=$package->get('Support.name');?></a></p>



<?php
return;


    echo "An email has been sent to <strong>".$data['email']."</strong>. Click the link in your email to set a new password.";
    //Maybe give a link to the home page or something??
    if ($success){
        $sys->sendActivationEmail($_POST['email'],$activation);
    } else {
        $sys->sendActivationFailureEmail($_POST['email']);
    }